import 'package:flutter/material.dart';
import 'package:flutter_app/pages/draw.dart';
import 'package:flutter_app/pages/home.dart';
import 'package:flutter_app/pages/image_edit.dart';
import 'package:flutter_app/pages/image_to_contours.dart';
import 'package:flutter_app/pages/images.dart';
import 'package:flutter_app/pages/opencv_test.dart';
import 'package:flutter_app/pages/white_board/white_board_page.dart';
import 'package:flutter_app/pages/paint_editor.dart';

class AppRoutes {
  static const String home = '/';
  static const String draw = '/draw';
  static const String imageToContour = '/image-to-contours';
  static const String opencvTest = '/opencv-test';
  static const String imageEdit = '/image-edit';
  static const String images = '/images';
  static const String paintEditor = '/paint-editor';
  static const String whiteBoard = '/white-board';

  static Route<dynamic> generateRoute(RouteSettings settings) {
    print(settings.name);
    switch (settings.name) {
      case home:
        return MaterialPageRoute(builder: (_) => HomePage());
      case draw:
        return MaterialPageRoute(builder: (_) => DrawPage());
      case imageToContour:
        return MaterialPageRoute(builder: (_) => ImageToContoursPage());
      case opencvTest:
        return MaterialPageRoute(builder: (_) => OpencvTestPage());
      case imageEdit:
        return MaterialPageRoute(builder: (_) => ImageEditPage());
      case images:
        return MaterialPageRoute(builder: (_) => ImagesPage());
      case paintEditor:
        return MaterialPageRoute(builder: (_) => PaintEditorPage());
      case whiteBoard:
        return MaterialPageRoute(builder: (_) => WhiteBoardPage());
      default:
        return MaterialPageRoute(
            builder: (_) => Scaffold(
                  body: Center(
                    child: Text('No route defined for ${settings.name}'),
                  ),
                ));
    }
  }
}
